//
//  TableViewController.m
//  9-20
//
//  Created by mac on 16/9/26.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "TableViewController.h"
#import "LeftViewCell.h"
#import "RightViewCell.h"

@interface TableViewController ()


@end

@implementation TableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    self.tableView.estimatedRowHeight = 44;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 6;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if(indexPath.row%2!=0)
    {
        LeftViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"textOne" forIndexPath:indexPath];
      
        cell.leftLable.text = self.news;
        cell.bubble.image = [cell.bubble.image resizableImageWithCapInsets:UIEdgeInsetsMake(30, 20,15, 30)];
        return cell;
    }
    else
    {
        RightViewCell *cell2 = [tableView dequeueReusableCellWithIdentifier:@"textTwo" forIndexPath:indexPath];
        cell2.rightLabel.text = @"老板好";
        cell2.bubble.image = [cell2.bubble.image resizableImageWithCapInsets:UIEdgeInsetsMake(30, 20,15, 30)];
        return cell2;
    }
}
@end
